1. Field of the Invention
The present invention relates to an information processing apparatus that provides a function of canceling a print job.
2. Description of the Related Art
A general printing system includes a printing apparatus that can perform recording on a paper medium, a control apparatus that controls the printing apparatus and generates print job data, and a communication interface that connects both the printing apparatus and the control apparatus. In the control apparatus, an operating system (hereinafter also referred to as an OS) is operating, and various types of software such as an application and a printer driver are operable on the OS. When a document generated by the application is printed, each of the application, the printer driver, and the OS performs required processing in a specified procedure to generate a print command, and the generated print command is sent to the printing apparatus so that the printing apparatus starts print processing on a paper medium. A conventional printer driver includes a user interface module for managing an input from a user or an application, a command generation module (hereinafter also referred to as a command generation filter) for generating a print command, and a communication control module (hereinafter also referred to as a language monitor) for controlling communication processing between a control apparatus and a printing apparatus as main elements. The printer driver including a group of these modules is referred to as a Version 3 driver (hereinafter also referred to as a V3 driver). The language monitor receives a print command generated by the command generation filter via an OS and sends the received print command to the printing apparatus to transfer a print job to the printing apparatus. Further, when the language monitor receives a request to cancel a print job from the user or the application, the language monitor performs processing for canceling the print job. At this time, if the printing apparatus is performing print processing for the print job to be canceled, the language monitor needs to instruct the OS to send a print cancel command to the printing apparatus, and cause the printing apparatus to stop the print processing for the print job. As another method, if the language monitor receives a request to cancel a print job while performing processing for sending a print command, the language monitor detects information about a break in the sent command and determines whether the print command has been completely sent to the printing apparatus according to the detected information. There is known a method for stopping printing in which, if the language monitor determines that the printing has not successfully been completed, the language monitor generates optimum complementary data and performs control to send the complementary data to a printer subsequent to the sent data (see Japanese Patent Application Laid-Open No. 2000-259368).
On the other hand, in Windows (registered trademark) 8 and Windows (registered trademark) RT, which have been introduced by Microsoft Corporation in recent years, a printer driver configuration different from the above-mentioned configuration has been used. A module group constituting a new printer driver does not include a language monitor. A usable communication port is limited to a universal serial bus (hereinafter also referred to as USB) port and a web service on device (hereinafter also referred to as WSD) port. The printer driver having such a configuration is referred to as a Version4 driver (hereinafter also referred to as a V4 driver). In the V4 driver, a spooler provides processing for sending a print command generated by a command generation filter to a printing apparatus. When a request to cancel a print job is issued from a user or an application, the spooler performs processing for canceling the print job.
However, if the printing apparatus and the control apparatus are connected to each other via a USB (trademark) and if an error that causes the printing apparatus to be unable to continue the print processing has occurred therein, even when a request to cancel a print job in which the error has occurred is issued, the spooler may not instruct the OS to send a print cancel command to the printing apparatus. Generally, when the spooler receives a request to cancel a print job, the spooler instructs the OS to send a print cancel command after executing EndDocPort( ) of a USB port monitor as processing for canceling the print job. However, if an error that causes the printing apparatus to be unable to continue the print processing has occurred therein, the USB port monitor cannot complete the processing in EndDocPort( ) and the spooler cannot issue a request to the OS to send a print cancel command subsequently to the processing. This causes a problem that even if the user or the application desires to stop printing for the print job in which the error has occurred, the error in the printing apparatus cannot be released, and the printing apparatus does not shift to an initial state or start the subsequent print job.
Instead of the spooler, the command generation filter serving as a constituent element of the V4 driver can also receive a request to cancel a print job from the user or the application, and instruct the OS to send a print cancel command to the printing apparatus. However, in the V4 driver, the spooler controls processing for sending print data to the printing apparatus, and the command generation filter cannot be involved in sending the generated print data. Thus, the command generation filter cannot determine which print job has been processed in the printing apparatus. Generally, the print cancel command is not to be issued to the printing apparatus if the printing apparatus does not process the print job to be canceled. More specifically, this restriction indicates that the command generation filter cannot appropriately determine whether to instruct the OS to send a print cancel command.